//
//  ZZMusicCell.m
//  ZZBlue
//
//  Created by stonesMonkey on 2017/9/17.
//  Copyright © 2017年 stonesMonkey. All rights reserved.
//

#import "ZZMusicCell.h"
#import "ZZMusicModel.h"
#import "ZZMusicList.h"
@interface ZZMusicCell()

@property (weak, nonatomic) IBOutlet UILabel *musicName;

@property (weak, nonatomic) IBOutlet UIImageView *playerIcon;


@end

@implementation ZZMusicCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
     self.playerIcon.hidden = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)btnDidClick:(UIButton *)sender {
    
    if (self.musicSelectBlock) {
        
        self.musicSelectBlock(self.model,self.musicList);
    }
}


- (void)setModel:(ZZMusicModel *)model {
    
    _model = model;
    if (model.isPlayer) {
        
        self.playerIcon.hidden = NO;
        self.musicName.textColor = [UIColor zColorWithHex:0xF8D11C];
        self.musicName.alpha = 1;
    } else {
        
        self.playerIcon.hidden = YES;
        self.musicName.textColor = [UIColor zColorWithHex:0xFFFFFF];
        self.musicName.alpha = 0.6;
    }
    
    self.musicName.text = model.musicName;
    
}
@end
